package com.bls.cate.test;

import android.provider.Settings;

import com.bls.cate.test.Utils.OkGoUtil;
import com.lzy.okgo.OkGo;
import com.lzy.okgo.callback.StringCallback;
import com.lzy.okgo.model.Progress;
import com.lzy.okgo.model.Response;
import com.lzy.okgo.request.PostRequest;

import java.io.File;

public class test {

    public void aa() {


        String file1 = "C:\\Users\\Administrator\\Desktop\\1.png";
        String file2 = "C:\\Users\\Administrator\\Desktop\\2.png";

        PostRequest<String> request = OkGo.<String>post("http://localhost:8080/Cate/Article/ArticleImageUpload")
                .tag("111")
                .params("param1", "1")
                .params("param2", "2");
        request.params("file_1", new File(file1));
        request.params("file_2", new File(file2));

        request.execute(new StringCallback() {
            @Override
            public void onSuccess(Response<String> response) {
                System.out.println(response);
            }

            @Override
            public void uploadProgress(Progress progress) {
                System.out.println(progress);
            }
        });
    }
}
